﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Web;
using System.ServiceModel;

using TerryDong.Bll.Models;
namespace suanpan.RestService
{
    [ServiceContract]
    public interface IMyService
    {
        [OperationContract]
        [WebInvoke(UriTemplate = "User/{uid}?name={name}", Method = "POST",ResponseFormat = WebMessageFormat.Xml)]
        User CreateUser(string uid, string name);

        [OperationContract]
        [WebGet(UriTemplate = "User/{uid}", ResponseFormat = WebMessageFormat.Xml)]
        User GetUser(string uid);

        [OperationContract]
        [WebInvoke(UriTemplate = "User/{uid}", Method = "DELETE",
          ResponseFormat = WebMessageFormat.Xml)]
        string DeleteUser(string uid);

        [OperationContract]
        [WebInvoke(UriTemplate = "User/{uid}", Method = "PUT",
          ResponseFormat = WebMessageFormat.Xml)]
        string UpdateUser(string uid);
    }
}
